home *** CD-ROM | disk | FTP | other *** search
/ Freelog 117 / FreelogNo117-OctobreNovembre2013.iso / Programmation / jedit / jedit5.1.0install.exe / {app} / modes / html.xml < prev    next >
Extensible Markup Language  |  2013-07-28  |  12KB  |  352 lines

  1. <?xml version="1.0"?>
  2.  
  3. <!DOCTYPE MODE SYSTEM "xmode.dtd">
  4.  
  5. <MODE>
  6.     <PROPS>
  7.         <PROPERTY NAME="commentStart" VALUE="<!--" />
  8.         <PROPERTY NAME="commentEnd" VALUE="-->" />
  9.     </PROPS>
  10.  
  11.     <RULES IGNORE_CASE="TRUE">
  12.         <!-- SGML comment -->
  13.         <SPAN TYPE="COMMENT1">
  14.             <BEGIN><!--</BEGIN>
  15.             <END>--></END>
  16.         </SPAN>
  17.  
  18.         <!-- JavaScript -->
  19.         <SEQ_REGEXP TYPE="MARKUP" DELEGATE="SCRIPT_TAG"
  20.                     HASH_CHAR="<"><(?=SCRIPT\b)</SEQ_REGEXP>
  21.  
  22.         <!-- stylesheet -->
  23.         <SEQ_REGEXP TYPE="MARKUP" DELEGATE="STYLE_TAG"
  24.                     HASH_CHAR="<"><(?=STYLE\b)</SEQ_REGEXP>
  25.  
  26.         <!-- DTD instructions -->
  27.         <SPAN TYPE="KEYWORD2" DELEGATE="xml::DTD-TAGS">
  28.             <BEGIN><!</BEGIN>
  29.             <END>></END>
  30.         </SPAN>
  31.  
  32.         <!-- markup tags -->
  33.         <SPAN TYPE="MARKUP" DELEGATE="TAGS">
  34.             <BEGIN><</BEGIN>
  35.             <END>></END>
  36.         </SPAN>
  37.  
  38.         <!-- SGML entities -->
  39.         <SPAN TYPE="LITERAL2" NO_WORD_BREAK="TRUE">
  40.             <BEGIN>&</BEGIN>
  41.             <END>;</END>
  42.         </SPAN>
  43.     </RULES>
  44.  
  45.     <!-- ESCAPE is not exactly right but it is needed to correctly
  46.          handle JavaScript in on* parameters.
  47.              NOTE: ESCAPE moved from RULE to SPANs! -->
  48.     <RULES SET="TAGS" DEFAULT="MARKUP">
  49.         <!-- Inline CSS -->
  50.          <SPAN_REGEXP AT_WORD_START="TRUE" TYPE="MARKUP" DELEGATE="css::PROPERTIES" HASH_CHAR="style">
  51.             <BEGIN>style\s*=\s*(["'])</BEGIN>
  52.             <END>$1</END>
  53.         </SPAN_REGEXP>
  54.  
  55.         <!-- Javascript: delegate on* attributes to Javascript mode -->
  56.          <SPAN_REGEXP AT_WORD_START="TRUE" DELEGATE="javascript::MAIN" HASH_CHAR="on" TYPE="MARKUP">
  57.             <BEGIN>on[a-z]+\s*=\s*(["'])</BEGIN>
  58.             <END>$1</END>
  59.         </SPAN_REGEXP>
  60.  
  61.         <!-- NOTE: no ESCAPE for quotes, at least for attributes; e.g onclick="alert(\"foo\");" is invalid! -->
  62.         <SPAN TYPE="LITERAL1" DELEGATE="STRING">
  63.             <BEGIN>"</BEGIN>
  64.             <END>"</END>
  65.         </SPAN>
  66.         <SPAN TYPE="LITERAL1" DELEGATE="STRING">
  67.             <BEGIN>'</BEGIN>
  68.             <END>'</END>
  69.         </SPAN>
  70.  
  71.         <SEQ TYPE="OPERATOR">=</SEQ>
  72.  
  73.         <KEYWORDS>
  74.             <!-- HTML/XHTML elements, taken from http://de.selfhtml.org/html/referenz/elemente.htm -->
  75.             <!-- updated to include html5 elements. Obsolete and deprecated elements
  76.             are still here for backward compatibility. -->
  77.             <KEYWORD1>a</KEYWORD1>
  78.             <KEYWORD1>abbr</KEYWORD1>
  79.             <KEYWORD1>acronym</KEYWORD1>
  80.             <KEYWORD1>address</KEYWORD1>
  81.             <KEYWORD1>applet</KEYWORD1>
  82.             <KEYWORD1>area</KEYWORD1>
  83.             <KEYWORD1>article</KEYWORD1>
  84.             <KEYWORD1>aside</KEYWORD1>
  85.             <KEYWORD1>audio</KEYWORD1>
  86.             <KEYWORD1>b</KEYWORD1>
  87.             <KEYWORD1>base</KEYWORD1>
  88.             <KEYWORD1>basefont</KEYWORD1>
  89.             <KEYWORD1>bdi</KEYWORD1>
  90.             <KEYWORD1>bdo</KEYWORD1>
  91.             <KEYWORD1>big</KEYWORD1>
  92.             <KEYWORD1>blockquote</KEYWORD1>
  93.             <KEYWORD1>body</KEYWORD1>
  94.             <KEYWORD1>br</KEYWORD1>
  95.             <KEYWORD1>button</KEYWORD1>
  96.             <KEYWORD1>canvas</KEYWORD1>
  97.             <KEYWORD1>caption</KEYWORD1>
  98.             <KEYWORD1>center</KEYWORD1>
  99.             <KEYWORD1>cite</KEYWORD1>
  100.             <KEYWORD1>code</KEYWORD1>
  101.             <KEYWORD1>col</KEYWORD1>
  102.             <KEYWORD1>colgroup</KEYWORD1>
  103.             <KEYWORD1>command</KEYWORD1>
  104.             <KEYWORD1>data</KEYWORD1>
  105.             <KEYWORD1>datalist</KEYWORD1>
  106.             <KEYWORD1>dd</KEYWORD1>
  107.             <KEYWORD1>del</KEYWORD1>
  108.             <KEYWORD1>details</KEYWORD1>
  109.             <KEYWORD1>dfn</KEYWORD1>
  110.             <KEYWORD1>dir</KEYWORD1>
  111.             <KEYWORD1>div</KEYWORD1>
  112.             <KEYWORD1>dl</KEYWORD1>
  113.             <KEYWORD1>dt</KEYWORD1>
  114.             <KEYWORD1>em</KEYWORD1>
  115.             <KEYWORD1>embed</KEYWORD1>
  116.             <KEYWORD1>fieldset</KEYWORD1>
  117.             <KEYWORD1>figcaption</KEYWORD1>
  118.             <KEYWORD1>figure</KEYWORD1>
  119.             <KEYWORD1>font</KEYWORD1>
  120.             <KEYWORD1>footer</KEYWORD1>
  121.             <KEYWORD1>form</KEYWORD1>
  122.             <KEYWORD1>frame</KEYWORD1>
  123.             <KEYWORD1>frameset</KEYWORD1>
  124.             <KEYWORD1>h1</KEYWORD1>
  125.             <KEYWORD1>h2</KEYWORD1>
  126.             <KEYWORD1>h3</KEYWORD1>
  127.             <KEYWORD1>h4</KEYWORD1>
  128.             <KEYWORD1>h5</KEYWORD1>
  129.             <KEYWORD1>h6</KEYWORD1>
  130.             <KEYWORD1>head</KEYWORD1>
  131.             <KEYWORD1>header</KEYWORD1>
  132.             <KEYWORD1>hgroup</KEYWORD1>
  133.             <KEYWORD1>hr</KEYWORD1>
  134.             <KEYWORD1>html</KEYWORD1>
  135.             <KEYWORD1>i</KEYWORD1>
  136.             <KEYWORD1>iframe</KEYWORD1>
  137.             <KEYWORD1>img</KEYWORD1>
  138.             <KEYWORD1>input</KEYWORD1>
  139.             <KEYWORD1>ins</KEYWORD1>
  140.             <KEYWORD1>isindex</KEYWORD1>
  141.             <KEYWORD1>kbd</KEYWORD1>
  142.             <KEYWORD1>keygen</KEYWORD1>
  143.             <KEYWORD1>label</KEYWORD1>
  144.             <KEYWORD1>legend</KEYWORD1>
  145.             <KEYWORD1>li</KEYWORD1>
  146.             <KEYWORD1>link</KEYWORD1>
  147.             <KEYWORD1>map</KEYWORD1>
  148.             <KEYWORD1>mark</KEYWORD1>
  149.             <KEYWORD1>menu</KEYWORD1>
  150.             <KEYWORD1>meta</KEYWORD1>
  151.             <KEYWORD1>meter</KEYWORD1>
  152.             <KEYWORD1>nav</KEYWORD1>
  153.             <KEYWORD1>noframes</KEYWORD1>
  154.             <KEYWORD1>noscript</KEYWORD1>
  155.             <KEYWORD1>object</KEYWORD1>
  156.             <KEYWORD1>ol</KEYWORD1>
  157.             <KEYWORD1>optgroup</KEYWORD1>
  158.             <KEYWORD1>option</KEYWORD1>
  159.             <KEYWORD1>output</KEYWORD1>
  160.             <KEYWORD1>p</KEYWORD1>
  161.             <KEYWORD1>param</KEYWORD1>
  162.             <KEYWORD1>pre</KEYWORD1>
  163.             <KEYWORD1>progress</KEYWORD1>
  164.             <KEYWORD1>q</KEYWORD1>
  165.             <KEYWORD1>rp</KEYWORD1>
  166.             <KEYWORD1>rt</KEYWORD1>
  167.             <KEYWORD1>ruby</KEYWORD1>
  168.             <KEYWORD1>s</KEYWORD1>
  169.             <KEYWORD1>samp</KEYWORD1>
  170.             <KEYWORD1>script</KEYWORD1>
  171.             <KEYWORD1>section</KEYWORD1>
  172.             <KEYWORD1>select</KEYWORD1>
  173.             <KEYWORD1>small</KEYWORD1>
  174.             <KEYWORD1>source</KEYWORD1>
  175.             <KEYWORD1>span</KEYWORD1>
  176.             <KEYWORD1>strike</KEYWORD1>
  177.             <KEYWORD1>strong</KEYWORD1>
  178.             <KEYWORD1>style</KEYWORD1>
  179.             <KEYWORD1>sub</KEYWORD1>
  180.             <KEYWORD1>summary</KEYWORD1>
  181.             <KEYWORD1>sup</KEYWORD1>
  182.             <KEYWORD1>table</KEYWORD1>
  183.             <KEYWORD1>tbody</KEYWORD1>
  184.             <KEYWORD1>td</KEYWORD1>
  185.             <KEYWORD1>textarea</KEYWORD1>
  186.             <KEYWORD1>tfoot</KEYWORD1>
  187.             <KEYWORD1>th</KEYWORD1>
  188.             <KEYWORD1>thead</KEYWORD1>
  189.             <KEYWORD1>time</KEYWORD1>
  190.             <KEYWORD1>title</KEYWORD1>
  191.             <KEYWORD1>tr</KEYWORD1>
  192.             <KEYWORD1>track</KEYWORD1>
  193.             <KEYWORD1>tt</KEYWORD1>
  194.             <KEYWORD1>u</KEYWORD1>
  195.             <KEYWORD1>ul</KEYWORD1>
  196.             <KEYWORD1>var</KEYWORD1>
  197.             <KEYWORD1>video</KEYWORD1>
  198.             <KEYWORD1>wbr</KEYWORD1>
  199.         </KEYWORDS>
  200.     </RULES>
  201.  
  202.     <!-- SCRIPT tag: Highlight tag and switch to language ruleset. -->
  203.     <RULES SET="SCRIPT_TAG" DEFAULT="MARKUP">
  204.         <!--If the content of the TYPE attribute is recognized, switch to
  205.             language specific ruleset. -->
  206.         <SEQ_REGEXP TYPE="MARKUP" DELEGATE="COFFEESCRIPT_TAG"
  207.                     HASH_CHAR="type">type(?=\s*=\s*['"]?text/coffeescript)</SEQ_REGEXP>
  208.         <SEQ_REGEXP TYPE="MARKUP" DELEGATE="VBSCRIPT_TAG"
  209.                     HASH_CHAR="type">type(?=\s*=\s*['"]?text/vbscript)</SEQ_REGEXP>
  210.         <SEQ_REGEXP TYPE="MARKUP" DELEGATE="VBSCRIPT_TAG"
  211.                     HASH_CHAR="language">language(?=\s*=\s*['"]?vbscript)</SEQ_REGEXP>
  212.         <SEQ_REGEXP TYPE="MARKUP" DELEGATE="PYTHON_SCRIPT_TAG"
  213.                     HASH_CHAR="type">type(?=\s*=\s*['"]?\w+/python)</SEQ_REGEXP>
  214.         <SEQ_REGEXP TYPE="MARKUP" DELEGATE="RUBY_SCRIPT_TAG"
  215.                     HASH_CHAR="type">type(?=\s*=\s*['"]?\w+/ruby)</SEQ_REGEXP>
  216.         <SEQ_REGEXP TYPE="MARKUP" DELEGATE="XML_SCRIPT_TAG"
  217.                     HASH_CHAR="type">type(?=\s*=\s*['"]?application/xml)</SEQ_REGEXP>
  218.         <SEQ_REGEXP TYPE="MARKUP" DELEGATE="XQUERY_SCRIPT_TAG"
  219.                     HASH_CHAR="type">type(?=\s*=\s*['"]?\w+/xquery)</SEQ_REGEXP>
  220.         <!-- Switch to JavaScript ruleset after the tag. -->
  221.         <SEQ TYPE="MARKUP" DELEGATE="JAVASCRIPT">></SEQ>
  222.         <!-- Import rules for highlighting. -->
  223.         <IMPORT DELEGATE="TAGS"/>
  224.     </RULES>
  225.  
  226.     <!-- JavaScript (NOTE: RULES attributes must match the imported rules.)-->
  227.     <RULES SET="JAVASCRIPT" 
  228.         IGNORE_CASE="FALSE"
  229.         HIGHLIGHT_DIGITS="TRUE"
  230.         DIGIT_RE="(0x[\p{XDigit}]+[lL]?|[\p{Digit}]+(e[\p{Digit}]*)?[lLdDfF]?)">
  231.         <!-- "Override" comments to avoid consuming the </SCRIPT> tag. -->
  232.         <SPAN_REGEXP TYPE="COMMENT1" HASH_CHAR="/*">
  233.             <BEGIN>/\*</BEGIN>
  234.             <END REGEXP="TRUE">(?i)(?=</SCRIPT\b)</END>
  235.         </SPAN_REGEXP>
  236.         <SEQ_REGEXP TYPE="COMMENT2" HASH_CHAR="//">(?i)//.*(?=</SCRIPT\b)</SEQ_REGEXP>
  237.         <!-- If closing </SCRIPT> tag is found, switch to ENDTAG ruleset. -->
  238.         <SEQ_REGEXP TYPE="MARKUP" DELEGATE="ENDTAG"
  239.                     HASH_CHAR="<">(?i)<(?=/SCRIPT\b)</SEQ_REGEXP>
  240.         <!-- Import rules for JavaScript mode. -->
  241.         <IMPORT DELEGATE="javascript::MAIN"/>
  242.     </RULES>
  243.  
  244.     <!-- CoffeeScript -->
  245.     <RULES SET="COFFEESCRIPT_TAG" DEFAULT="MARKUP">
  246.         <SEQ TYPE="MARKUP" DELEGATE="COFFEESCRIPT">></SEQ>
  247.         <IMPORT DELEGATE="TAGS"/>
  248.     </RULES>
  249.     <RULES SET="COFFEESCRIPT"
  250.         IGNORE_CASE="FALSE"
  251.         HIGHLIGHT_DIGITS="TRUE"
  252.         NO_WORD_SEP="$_"
  253.         DIGIT_RE="(0b[01]+)|(0o[0-7]+)|(0x\p{XDigit}+)|(\d*\.?\d+(e[+-]?\d+)?)">
  254.         <SPAN_REGEXP TYPE="COMMENT2" HASH_CHAR="###">
  255.             <BEGIN>###(?!#)</BEGIN>
  256.             <END REGEXP="TRUE">(?i)(?=</SCRIPT\b)</END>
  257.         </SPAN_REGEXP>
  258.         <SEQ_REGEXP TYPE="COMMENT1" HASH_CHAR="#">(?i)#.*(?=</SCRIPT\b)</SEQ_REGEXP>
  259.         <SEQ_REGEXP TYPE="MARKUP" DELEGATE="ENDTAG"
  260.                     HASH_CHAR="<">(?i)<(?=/SCRIPT\b)</SEQ_REGEXP>
  261.         <IMPORT DELEGATE="coffeescript::MAIN"/>
  262.     </RULES>
  263.  
  264.     <!-- Python - provided by Gestalt -->
  265.     <RULES SET="PYTHON_SCRIPT_TAG" DEFAULT="MARKUP">
  266.         <SEQ TYPE="MARKUP" DELEGATE="PYTHON">></SEQ>
  267.         <IMPORT DELEGATE="TAGS"/>
  268.     </RULES>
  269.     <RULES SET="PYTHON" IGNORE_CASE="FALSE" HIGHLIGHT_DIGITS="TRUE">
  270.         <SEQ_REGEXP TYPE="COMMENT1" HASH_CHAR="#">(?i)#.*(?=</SCRIPT\b)</SEQ_REGEXP>
  271.         <SEQ_REGEXP TYPE="MARKUP" DELEGATE="ENDTAG"
  272.                     HASH_CHAR="<">(?i)<(?=/SCRIPT\b)</SEQ_REGEXP>
  273.         <IMPORT DELEGATE="python::MAIN"/>
  274.     </RULES>
  275.  
  276.     <!-- Ruby - provided by Gestalt -->
  277.     <RULES SET="RUBY_SCRIPT_TAG" DEFAULT="MARKUP">
  278.         <SEQ TYPE="MARKUP" DELEGATE="RUBY">></SEQ>
  279.         <IMPORT DELEGATE="TAGS"/>
  280.     </RULES>
  281.     <RULES SET="RUBY" IGNORE_CASE="FALSE" HIGHLIGHT_DIGITS="TRUE"
  282.         DIGIT_RE="(0b[01]([01_]*[01])?)|(0x[\p{XDigit}]([\p{XDigit}_]*[\p{XDigit}])?)|(0([0-7_]*[0-7])?)|(0d[0-9]([0-9_]*[0-9])?)|([1-9]([0-9_]*[0-9])?)|([0-9]([0-9_]*[0-9])?[Ee]([0-9]([0-9_]*[0-9])?)?)">
  283.         <SEQ_REGEXP TYPE="COMMENT1" HASH_CHAR="#">(?i)#.*(?=</SCRIPT\b)</SEQ_REGEXP>
  284.         <SEQ_REGEXP TYPE="MARKUP" DELEGATE="ENDTAG"
  285.                     HASH_CHAR="<">(?i)<(?=/SCRIPT\b)</SEQ_REGEXP>
  286.         <IMPORT DELEGATE="ruby::MAIN"/>
  287.     </RULES>
  288.  
  289.     <!-- VBScript - provided by Internet Explorer -->
  290.     <RULES SET="VBSCRIPT_TAG" DEFAULT="MARKUP">
  291.         <SEQ TYPE="MARKUP" DELEGATE="VBSCRIPT">></SEQ>
  292.         <IMPORT DELEGATE="TAGS"/>
  293.     </RULES>
  294.     <RULES SET="VBSCRIPT" HIGHLIGHT_DIGITS="TRUE">
  295.         <SEQ_REGEXP TYPE="COMMENT1" HASH_CHAR="'">'.*(?=</SCRIPT\b)</SEQ_REGEXP>
  296.         <SEQ_REGEXP TYPE="COMMENT1" HASH_CHAR="rem">rem(\b.*)?(?=</SCRIPT\b)</SEQ_REGEXP>
  297.         <SEQ_REGEXP TYPE="MARKUP" DELEGATE="ENDTAG"
  298.                     HASH_CHAR="<"><(?=/SCRIPT\b)</SEQ_REGEXP>
  299.         <IMPORT DELEGATE="vbscript::MAIN"/>
  300.     </RULES>
  301.  
  302.     <!-- XML - for XAML, provided by Gestalt -->
  303.     <RULES SET="XML_SCRIPT_TAG" DEFAULT="MARKUP">
  304.         <SEQ TYPE="MARKUP" DELEGATE="XML">></SEQ>
  305.         <IMPORT DELEGATE="TAGS"/>
  306.     </RULES>
  307.     <RULES SET="XML">
  308.         <SEQ_REGEXP TYPE="MARKUP" DELEGATE="ENDTAG"
  309.                     HASH_CHAR="<"><(?=/SCRIPT\b)</SEQ_REGEXP>
  310.         <IMPORT DELEGATE="xml::MAIN"/>
  311.     </RULES>
  312.  
  313.     <!-- XQUERY - provided by XQIB -->
  314.     <RULES SET="XQUERY_SCRIPT_TAG" DEFAULT="MARKUP">
  315.         <SEQ TYPE="MARKUP" DELEGATE="XQUERY">></SEQ>
  316.         <IMPORT DELEGATE="TAGS"/>
  317.     </RULES>
  318.     <RULES SET="XQUERY">
  319.         <SEQ_REGEXP TYPE="MARKUP" DELEGATE="ENDTAG"
  320.                     HASH_CHAR="<"><(?=/SCRIPT\b)</SEQ_REGEXP>
  321.         <IMPORT DELEGATE="xq::MAIN"/>
  322.     </RULES>
  323.  
  324.     <!-- STYLE tag: Highlight tag and delegate to CSS mode. -->
  325.     <RULES SET="STYLE_TAG" DEFAULT="MARKUP">
  326.         <SEQ TYPE="MARKUP" DELEGATE="CSS">></SEQ>
  327.         <IMPORT DELEGATE="TAGS"/>
  328.     </RULES>
  329.  
  330.     <RULES SET="CSS"
  331.         HIGHLIGHT_DIGITS="TRUE"
  332.         DIGIT_RE="-?\d+(\.\d+)?(pt|pc|in|mm|cm|em|ex|px|ms|s|%|)"
  333.         NO_WORD_SEP="-_%">
  334.         <SEQ_REGEXP TYPE="MARKUP" DELEGATE="ENDTAG"
  335.                     HASH_CHAR="<"><(?=/STYLE\b)</SEQ_REGEXP>
  336.         <IMPORT DELEGATE="css::MAIN"/>
  337.     </RULES>
  338.  
  339.     <!-- Closing tag: Highlight tag and return to MAIN ruleset. -->
  340.     <RULES SET="ENDTAG" DEFAULT="MARKUP">
  341.         <SEQ TYPE="MARKUP" DELEGATE="MAIN">></SEQ>
  342.         <IMPORT DELEGATE="TAGS"/>
  343.     </RULES>
  344.     
  345.      <RULES SET="STRING" DEFAULT="LITERAL1">
  346.          <SPAN TYPE="LITERAL2" NO_WORD_BREAK="TRUE">
  347.              <BEGIN>&</BEGIN>
  348.              <END>;</END>
  349.          </SPAN>
  350.      </RULES>    
  351. </MODE>
  352.